<template>
  <div>
    <transition name="slide-up">
      <div class="menu-wrapper" :class="{'hide-box-shadow':!titleShow||SettingFontSize!=-1}" v-show="titleShow">
        <div class="icon-wrapper">
          <span class="icon-menu" @click="showSetting(3)"></span>
        </div>
        <div class="icon-wrapper">
          <span class="icon-progress" @click="showSetting(2)"></span>
        </div>
        <div class="icon-wrapper">
          <span class="icon-bright" @click="showSetting(1)"></span>
        </div>
        <div class="icon-wrapper">
          <span class="icon-A" @click="showSetting(0)"></span>
        </div>
      </div>
    </transition>
    <ebook-setting-font></ebook-setting-font>
    <ebook-setting-font-popup></ebook-setting-font-popup>
  </div>
</template>

<script>
import { ebookMixin } from "./../../utils/mixin";
import EbookSettingFont from "./EbookSettingFont";
import EbookSettingFontPopup from "./EbookSettingFontPopup";
export default {
  mixins: [ebookMixin],
  components: {
    EbookSettingFont,
    EbookSettingFontPopup
  },
  methods: {
    showSetting(key) {
      switch (key) {
        case 0:
          if (this.SettingFontSize == 0) {
            this.setFontSize(-1);
          } else {
            this.setFontSize(0);
          }
          break;
        case 1:
          if (this.SettingFontSize == 1) {
            this.setFontSize(-1);
          } else {
            console.log("主题");
            this.setFontSize(1);
          }
          break;
          case 2:
          if (this.SettingFontSize == 2) {
            this.setFontSize(-1);
          } else {
            console.log("2进度条");
            this.setFontSize(2);
          }
          break;
          case 3:
          if (this.SettingFontSize ==3) {
            this.setFontSize(-1);
          } else {
            console.log("3目录");
            this.setFontSize(3);
          }
          break;
      }
    }
  }
};
</script>

<style lang="scss">
@import "./../../assets/styles/global";
.menu-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 102;
  display: flex;
  width: 100%;
  height: px2rem(48);
  background: white;
  box-shadow: 0 px2rem(-8) px2rem(8) rgba(0, 0, 0, 0.15);
  &.hide-box-shadow {
    box-shadow: none;
  }
  .icon-wrapper {
    flex: 1;
    font-size: px2rem(22);
    @include center;
    .icon-progress {
      font-size: px2rem(22);
    }
    .icon-bright {
      font-size: px2rem(22);
    }
  }
}
</style>